{% extends "base.html" %}
{% block page_title %}Password Reset{% endblock %}

{% load account %}

{% block content %}
<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <div class="card">
      <div class="cardface">
        <h2>Password Reset</h2>
        {% if user.is_authenticated %}
          {% include "account/snippets/already_logged_in.html" %}
        {% endif %}
        <p>
          Forgot your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.
        </p>
        {% if form.non_field_errors %}
          <div class="bg-danger alert">
            {% for err in form.non_field_errors %}
              <p class="form-error">{{ err }}</p>
            {% endfor %}
          </div>
        {% endif %}
        <form role="form" method="post" action="{% url 'account_reset_password' %}">
          {% csrf_token %}
          <div class="form-group">
            <label class="control-label" for="{{ form.email.id_for_label }}">{{ form.email.label }}</label>
            <input class="form-control" id="{{ form.email.id__for_label }}" maxlength="30" name="{{ form.email.html_name }}" type="email" placeholder="{{ form.email.label }}" />
            {{ form.email.errors }}
          </div>
          <div class="form-group">
            <button class="btn btn-primary" type="submit">Reset My Password</button>
          </div>
        </form>
        <p>Please contact us if you have any trouble resetting your password.</p>
      </div>
    </div>
  </div>
</div>
{% endblock %}
